package net.sky.oa.service.addrbook.impl;

import java.util.List;

import javax.annotation.Resource;

import net.sky.oa.dao.addrbook.AddMyaddrDao;
import net.sky.oa.model.AddMyaddr;
import net.sky.oa.service.addrbook.AddMyaddrService;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.htsoft.core.command.QueryFilter;
import com.htsoft.core.service.impl.BaseServiceImpl;
import com.htsoft.core.web.paging.PagingBean;

@Service
@Transactional
public class AddMyaddrServiceImpl extends BaseServiceImpl<AddMyaddr> implements AddMyaddrService {
	
	private AddMyaddrDao dao;

	public AddMyaddrServiceImpl() {}
	
	public AddMyaddrServiceImpl(AddMyaddrDao dao) {
		super.setDao(dao);
		this.dao = dao;
	}

	public List<AddMyaddr> findAllMyaddr() {
		return this.dao.findAllMyaddr();
	}
	
	public List<AddMyaddr> findPub(String name, String sex, String pubuser, PagingBean pb) {
		return this.dao.findPub(name, sex, pubuser,pb);
	}
 
	@Resource
	public void setDao(AddMyaddrDao dao) {
		super.setDao(dao);
		this.dao = dao;
	}
	
	public int getCount(QueryFilter filter){
		return this.dao.getCountByFilter(filter);
	}
	
}